import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'// 引入echarts
import echarts from '../node_modules/echarts'   //全局引入echarts插件

import './assets/css/global.css' //导入全局样式表
//导入vue-table 树形表格
import TreeTable from 'vue-table-with-tree-grid'

Vue.component('tree-table', TreeTable)

// 导入elemen UI
import ElementUI from '../node_modules/element-ui'
import '../node_modules/element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

//axios
import axios from 'axios'
//配置请求根路径
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
axios.interceptors.request.use(config => {
  console.log(config);
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})
Vue.prototype.$http = axios

Vue.prototype.$echarts = echarts

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
